In tight gas formations, hydraulic fracturing treatments are often carried out in multiple stages when there are many gas bearing formation layers (payzones) over a large depth interval in a well. The minimum horizontal in-situ stress has a strong effect on hydraulic fracture height, and the hydraulic fracture height is an important factor to consider in designing the treatments. It is time consuming to manually design staged hydraulic fracturing treatments in tight gas formations when the number of payzones is large (over 100). The design of fracturing treatments depends on many factors, such as petrophysical and geomechanical properties of the formation. Algorithms are available for staging design based on petrophysical properties, but the in-situ stresses have not been considered in such algorithms. The minimum horizontal in-situ stress has a strong effect on hydraulic fracture height (FIG. 1 Prior Art), and the hydraulic fracture height is an important factor to consider in designing the treatments. The fracture height may determine how many pay zones are stimulated by one fracture, and how many fractures are grouped into one stage. The design objective is to have all pay zones stimulated by a number of hydraulic fractures, and to have no or minimal overlapping of fracture heights. Each fracture height can be estimated from a fracture height model and minimum horizontal in-situ stress distribution versus depth. It is desirable to automatically design such staged treatments using a computer program that takes into account in-situ stress and fracture height.